library(survey)
library(dplyr)
library(ggplot2)
library(gridExtra)
library(haven)
library(ggplot2)

# Figure 8.3
df.mtf <- read_dta("C:/Users/Robert Allred/Documents/Duke/Civ_Mil_Appendix/Data/MTF_Aggregate.dta")

# Line plot without points
ggplot(data=df.mtf, aes(x=var1))+
  geom_line(aes(y=confchange,linetype="Military Doing a Good Job"),
            size=1.03)+
  geom_line(aes(y=willchange,linetype="Will Probably Join the Military"),
            size=1.03)+
  geom_line(aes(y=defwillchange,linetype="Will Definitely Join the Military"),
            size=1.03)+
  scale_y_continuous(limits=c(-10,15))+
  scale_x_continuous(limits=c(1995,2019.5))+
  scale_linetype_manual(breaks=c("Military Doing a Good Job",
                                 "Will Probably Join the Military",
                                 "Will Definitely Join the Military"),
                        values = c(1,2,3))+
  geom_hline(yintercept=0,color='gray')+
  xlab("\nYear")+
  ylab("% Point Change From Previous Year")+
  theme(panel.grid = element_blank(), panel.background = element_blank(),
        panel.border = element_rect(fill=NA),
        text = element_text(size=16), legend.position = "bottom", 
        legend.title = element_blank())
